/**************************************************************************************************
* Title: SimulationManager.h
* Authors: Gael Huber
* Description: Manages the actual game
**************************************************************************************************/
#ifndef __SIMULATIONMANAGER_H__
#define __SIMULATIONMANAGER_H__

#include <stdio.h>
#include <time.h>

#include "SmurfsRenderManager.h"
#include "SmurfsInputManager.h"
#include "SmurfsVector2.h"
#include <math.h>

class SimulationManager {
public:
	SimulationManager(void);	// Constructor
	~SimulationManager(void);	// Destructor

	void startUp(void);	// Initialize
	void shutDown(void);	// Shutdown

	void gameLoop(void);	// Update
private:
	void physics(void);	// Physics
	bool checkCollision(RenderObject a);	// Check for collision with a paddle
	int checkBounds(RenderObject* obj);

	void moveAI(void);			// move the ai - this will change when we actually give it the ability to play

	void setSpeed(void);		// set the speed of the ai paddle to make it a bit more fair

	void moveBall(void);		// move the ball and react to collisions with the walls

	void setPaddleBounds(void);	// Set the paddle bounds

	InputManager* inputMgr;		// Manager for keyboard and mouse input

	RenderObject player;	// Player
	RenderObject ai;		// Opponent AI
	RenderObject ball;		// Ball

	// score counters
	int playerScore;
	int aiScore;

	int aiDirection;		// the direction the ai is moving: 1 = Down 0 = Not -1 = Up
	float aiSpeed;			// the speed of the ai

	Vector2 ballVelocity;	// the current velocity of the ball

	float paddleRotatePlayer;	// Rotate the player's paddle
	float paddleRotateAI;	// Rotate the AI's paddle
	float playerBounds;	// Player paddle bounds
	float aiBounds;	// AI paddle bounds
};

#endif